<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <link rel="shortcut icon" href="images/favicon.ico"/>
        <title>JForum :: #{resourcesController.extractResource('FORUM_SEARCH')}</title>
    </h:head>
    <h:body style="background-color: #111111">

      <div id="header">
		<ui:insert name="header" >
			<ui:include src="header.xhtml" />
		</ui:insert>
      </div>
        
        <center>
          <h:form>
              
         
           <p:dataTable  var="post"
                         value="#{searchBean.foundPosts}"
                         style="width: 780px"
                         liveScroll="true"
                         paginator="true" rows="15"
                         paginatorTemplate="{PreviousPageLink} {PageLinks} {NextPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15">

                <f:facet name="header">
                    #{resourcesController.extractResource('FORUM_SEARCH')}
                </f:facet>
               
                <p:column>
                    <f:facet name="header">
                        <h:outputText value="#{resourcesController.extractResource('TOPIC')}" />
                    </f:facet>

                    <p:commandLink action="#{searchBean.showThread(post.tid)}"
                                       value="#{searchBean.getThreadName(post.tid)}"
                                       ajax="false"
                                       async="true"
                                       />
         
                   
                </p:column>

                <p:column>
                    <f:facet name="header">
                        <h:outputText value="#{resourcesController.extractResource('MESSAGE')}" />
                    </f:facet> 
                    <h:outputText value="#{post.text}"
                                  escape="false" />

                </p:column>

            </p:dataTable>

           </h:form>
       </center>
        
      <ui:insert name="footer" >
	  <ui:include src="footer.xhtml" />
      </ui:insert>  
    </h:body>
</html>